package com.pagepub.core.utils;

import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;

/**
 * <p>
 * Title: 全局配置信息
 * </p>
 * 
 * <p>
 * Description: 从配置文件中提取全局的默认值信息
 * 
 * 
 * 
 * </p>
 * 
 * <p>
 * Copyright: Copyright (c) 2008 All Rights Reserved
 * </p>
 * 
 * <p>
 * Company: 页面出版信息有限公司
 * </p>
 * 
 * @author 郭光达 2006-9-9
 * @version 1.00.00
 * @history String s = "1"; byte b = Byte.parseByte( s ); short t =
 *          Short.parseShort( s ); int i = Integer.parseInt( s ); long l =
 *          Long.parseLong( s ); Float f = Float.parseFloat( s ); Double d =
 *          Double.parseDouble( s );
 * 
 */

public class Config {
	public static final String FILE_SEPARATOR = System.getProperties()
			.getProperty("file.separator");

	private final static String MGRCONFIG_SYSTEM_SOURCE = "conf.config";

	private PropertyResourceBundle bundle = null;

	public static int DEFUALT_SMALL_PAGESIZE = new Integer(5); // 默认分页条数：5

	public static int DEFUALT_BIG_PAGESIZE = new Integer(10); // 默认分页条数：10

	public static int ISVALID = 0; // 使用标志：0 - 使用中1 -被删除 2回收站内删除

	public static int ISVALIDDEL = 1; // 使用标志：0 - 使用中1 -被删除 2回收站内删除

	public static int ISVALIDDELAGAIN = 2; // 使用标志：0 - 使用中1-被删除 2回收站内删除

	public static int ISSYSTEM = 1; // 是否系统管理员：0 - 不是1 - 是
	public static int ISNOTSYSTEM = 0; // 是否系统管理员：0 - 不是1 - 是
	
	public static int ISSYSTEMTYPE = 9; // 系统管理员的角色类型
	
	public static int ISNOTSYSTEMTYPE = 0; // 不是系统管理员的角色类型

	// 三级菜单
	public static int MENUTYPE = 0;
	public static int ONELEVEL = 1;
	public static int TWOLEVEL = 2;
	public static int THIDLEVEL = 3;
	
	public static String THIRDADD = "0";//新增
	
	public static String THIRDLIST = "0";//列表

	public static String THIRDMODIFY = "0";//修改

	public static String THIRDDELETE = "0";//删除
	
	public static String THIRDDELETALL = "0";//全部删除
	
	public static String THIRDAUTI = "0";//审核

	public static String THIRDADDSUBLIST = "0";//新增子类
	
	public static String THIRDSET = "0";//设置
	
	public static String THIRDPASSWORDINIT = "0";//密码还原
	
	public static String INITPASSWORD = "0";//初始密码还原
	
	public static int INITTIME = 0;//公共消息初始时间
	
	public static String SEXDICT = "0";//姓别字典

	public static String MARRSDICT = "0";//婚姻字典
	
	public static String STATUSDICT = "0";//员工状态字典
	
	public static String THIRDMENUDICT = "0";//三级菜单字典
	
	public static String ADMINNID = "0";//超级管理员用户ID
	
	public static String UpIMGTypeLogo = "0";// FTP上图片类型0 企业图片，1，产品图片，2.新闻图片
	// 3.电子书图片


	public static String UpIMGTypeProduct = "1";
	
	public static String UpIMGTypeNews = "2";
	
	public static String UpIMGTypePub = "3";
	
	public static String UpXMLTypeDict = "1";
	
	public static String UpXMLTypePub = "2";
	
	public static String UpXMLTypeMap = "3";
	
	public static String StrNoTop = "0";
	
	public static String StrTop = "1";
	
	public static String StrNoBottom = "0";
	
	public static String StrBottom = "1";
	
	public static String StrNoBackGroup = "0";
	
	public static String StrBackGroup = "1";
	
	public static String FileNameTopThumb = "thumb.jpg";
	
	public static String BOOKURL = "thumb/";
	
	public static String CHANNAL = "channal"+FILE_SEPARATOR+"";
	
	public static String NWES = "news"+FILE_SEPARATOR;
	
	public static String INDEX_PATH = "C:"+FILE_SEPARATOR+"target"+FILE_SEPARATOR+"index";
	
	public static String UpLoad = "C:"+FILE_SEPARATOR+"website"+FILE_SEPARATOR+"ebwing";
	
	public static String PubUpLoad = "G:"+FILE_SEPARATOR+"ftp"+FILE_SEPARATOR+"pubimg"+FILE_SEPARATOR+"images";
	
	public static String UpPhotoKey = "917FC2384C257A5238863701FDBCF2FEE61F377C200EC1FD";
	
	public static String UpPhotoPage = "http:"+FILE_SEPARATOR+""+FILE_SEPARATOR+"192.168.1.89:8011"+FILE_SEPARATOR+"images"+FILE_SEPARATOR+"ImgManage?event=upPhoto";
	
	public static String ImageServerURL_CORP = "expo/member/";
	
	public static String ImageServerURL_CORPPUBIMG = "expo/pub/";
	
	public static String DefaultImage_WEBNEWS_SMALL = "default_small.gif";
	
	public static String DefaultImage_WEBNEWS_BIG = "default_big.gif";
	
	public static String DefaultImage_WAPNEWS_SMALL = "default_wap_small.gif";
	
	public static String DefaultImage_WAPNEWS_BIG = "default_wap_big.gif";
	
	public static String DefaultImage_MEMBER_PUBIMG_BIG = "default_big.gif";
	
	public static String DefaultImage_MEMBER_PUBIMG_SMALL = "default_small.gif";
	
	public static String DefaultImage_MEMBER_PUBIMG_WAP_BIG = "default_wap_big.gif";
	
	public static String DefaultImage_MEMBER_PUBIMG_WAP_SMALL = "default_wap_small.gif";
	
	public static String DefaultImage_MEMBER_LOGO = "default_logo.gif";
	
	public static int MAXUPLOADSIZ = 0;
	
	public static int Backgroundalpha = new Integer(100); 
	
	private final static Config config = new Config();

	private Config() {
		try {

			bundle = (PropertyResourceBundle) ResourceBundle
					.getBundle(MGRCONFIG_SYSTEM_SOURCE);
			initSystemBundle(bundle);
		} catch (Exception exception) {
			exception.printStackTrace();
		}
	}

	/**
	 * 系统配置信息
	 * 
	 * @param bundle
	 */
	private synchronized static void initSystemBundle(
			PropertyResourceBundle bundle) {
		
		UpIMGTypeLogo = bundle.getString("UpIMGTypeLogo");
		UpIMGTypeProduct = bundle.getString("UpIMGTypeProduct");
		UpIMGTypeNews = bundle.getString("UpIMGTypeNews");
		UpIMGTypePub = bundle.getString("UpIMGTypePub");
		UpXMLTypeDict = bundle.getString("UpXMLTypeDict");
		UpXMLTypePub = bundle.getString("UpXMLTypePub");
		UpXMLTypeMap = bundle.getString("UpXMLTypeMap");
		StrNoTop = bundle.getString("StrNoTop");
		StrTop = bundle.getString("StrTop");
		StrNoBottom = bundle.getString("StrNoBottom");
		StrBottom = bundle.getString("StrBottom");
		StrNoBackGroup = bundle.getString("StrNoBackGroup");
		StrBackGroup = bundle.getString("StrBackGroup");
//		UpLoad = bundle.getString("UpLoad");
//		PubUpLoad = bundle.getString("PubUpLoad");
		UpPhotoKey = bundle.getString("UpPhotoKey");
//		UpPhotoPage = bundle.getString("UpPhotoPage");
		ImageServerURL_CORP = bundle.getString("ImageServerURL_CORP");
		ImageServerURL_CORPPUBIMG = bundle
				.getString("ImageServerURL_CORPPUBIMG");
		DefaultImage_WEBNEWS_SMALL = bundle
				.getString("DefaultImage_WEBNEWS_SMALL");
		DefaultImage_WEBNEWS_BIG = bundle.getString("DefaultImage_WEBNEWS_BIG");
		DefaultImage_WAPNEWS_SMALL = bundle
				.getString("DefaultImage_WAPNEWS_SMALL");
		DefaultImage_WAPNEWS_BIG = bundle.getString("DefaultImage_WAPNEWS_BIG");
		DefaultImage_MEMBER_PUBIMG_BIG = bundle
				.getString("DefaultImage_MEMBER_PUBIMG_BIG");
		DefaultImage_MEMBER_PUBIMG_SMALL = bundle
				.getString("DefaultImage_MEMBER_PUBIMG_SMALL");
		DefaultImage_MEMBER_PUBIMG_BIG = bundle
				.getString("DefaultImage_MEMBER_PUBIMG_BIG");
		DefaultImage_MEMBER_PUBIMG_WAP_SMALL = bundle
				.getString("DefaultImage_MEMBER_PUBIMG_WAP_SMALL");
		DefaultImage_MEMBER_LOGO = bundle.getString("DefaultImage_MEMBER_LOGO");
		
	}
	 public static void main(String[] args) {
	        System.out.println(config);


	    }
}
